/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoopp.framework;

import android.content.Context;
import android.os.Environment;
import android.text.format.Time;
import android.util.Log;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;

public class LogUtil {
    private static final boolean DBG_V = 0;
    private static final boolean DBG_D = 0;
    private static final boolean DBG_I = 0;
    private static final boolean DBG_W = 0;
    private static final boolean DBG_E = 0;
    private static final boolean DBG_F = 0;
    public static final boolean DBG_TOAST = 0;
    public static final boolean DBG_THROWEXCETON = 0;
    private static final boolean DBG_LOG_E = 0;
    private static final boolean DBG_LOG_ALL = 1;
    private static Context mContext;
    private static HashMap mMap;
    private static HashMap sDBGLevels = null;
    private static FileOutputStream sDBGOutputStream = null;

    public static void init(Context paramContext, HashMap paramHashMap) {
        mContext = paramContext;
        mMap = paramHashMap;
        if (mContext == null)
            return;
        new f(mContext, mMap).a("").start();
    }

    public static void update_version(String paramString) {
        if (mMap == null)
            return;
        paramString = ((String) mMap.get("version=")) + "v" + paramString;
        Log.d("update_version", paramString);
        mMap.remove("version=");
        mMap.put("version=", paramString);
    }

    public static HashMap getLogInfo() {
        return mMap;
    }

    public static void v(String paramString1, String paramString2) {}

    public static void v(String paramString1, String paramString2, Throwable paramThrowable) {}

    public static void d(String paramString1, String paramString2) {}

    public static void d(String paramString1, String paramString2, Throwable paramThrowable) {}

    public static void i(String paramString1, String paramString2) {}

    public static void i(String paramString1, String paramString2, Throwable paramThrowable) {}

    public static void w(String paramString1, String paramString2) {}

    public static void w(String paramString1, String paramString2, Throwable paramThrowable) {}

    public static void w(String paramString, Throwable paramThrowable) {}

    public static void e(String paramString1, String paramString2) {}

    public static void e(String paramString1, String paramString2, Throwable paramThrowable) {}

    public static synchronized void f(String paramString1, String paramString2) {}

    public static synchronized void f(int paramInt, String paramString1, String paramString2) {}

    private static synchronized void toFile(int paramInt, String paramString1, String paramString2) {
        if (sDBGOutputStream == null)
            initDBGOutputStream();
        if (sDBGOutputStream == null)
            return;
        try {
            Time localTime;
            (localTime = new Time()).setToNow();
            paramInt = localTime.format2445() + " " + ((String) sDBGLevels.get(Integer.valueOf(paramInt))) + "/"
                    + paramString1 + " " + paramString2 + "\r\n";
            sDBGOutputStream.write(paramInt.getBytes("UTF-8"));
            sDBGOutputStream.flush();
            return;
        } catch (Exception localException) {
            localException.printStackTrace();
            try {
                sDBGOutputStream.close();
            } catch (IOException localIOException) {
                localIOException.printStackTrace();
            }
            sDBGOutputStream = null;
        }
    }

    private static void initDBGOutputStream() {
        if (!(Environment.getExternalStorageState().equals("mounted")))
            return;
        File localFile = new File(Environment.getExternalStorageDirectory(), "trace.txt");
        try {
            sDBGOutputStream = new FileOutputStream(localFile, true);
            return;
        } catch (FileNotFoundException localFileNotFoundException) {
            localFileNotFoundException.printStackTrace();
        }
    }

    public static void toast(Context paramContext, String paramString) {}
}